<?php 
class Ville{
	private $name;
	private $residencesId;
	private $residencesName;
	function __construct($name){
	 	$this->name=$name;
	 	$query="select id_residence,nom_residence from residence where ville='$name' ";
	 	$result=runQuery($query);
	 	$id_residences="";
	 	$nom_residences="";
		while ($row=mysql_fetch_assoc($result)){
		$id_residences .=$row['id_residence'].",";
		$nom_residences .=$row['nom_residence'].",";
		}
		$id_residences=substr_replace($id_residences, '', '-1');
		$nom_residences=substr_replace($nom_residences, '', '-1');
		$this->residencesId=explode(",",$id_residences);
		$this->residencesName=explode(",",$nom_residences);
	 }
	function __destruct(){
	 }
	public function getName(){return $this->name;}
	public function getResidencesId(){return $this->residencesId;}
	public function getResidencesName(){return $this->residencesName;}
	
	public function setName(){
		
	}
	public function setResidences(){
	}
	
	
}